package com.kfm.usermanagement.service;

import com.github.pagehelper.PageHelper;
import com.kfm.usermanagement.mapper.UserMapper;
import com.kfm.usermanagement.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

// @Component SpringBoot启动就可以创建该注解标注的类的对象
@Component
public class UserService2 {


    // 将自动创建的对象赋值给标注的属性值
    @Autowired
    private UserMapper mapper;

    public List<User> findAll() {
        PageHelper.startPage(1, 5);
        return mapper.selectAll();
    }



}
